﻿@{
    ViewBag.Title = "客户留言";
    Layout = "~/Views/Shared/_DefLayout.cshtml";
}

<div class="topadimg"><img src="/Images/banner04.jpg" /></div>
<div class="subleft">
    <h2>
        <img src="/Images/subicon04.jpg" alt="" />
        <span>联系我们</span>
    </h2>
    <ul class="left_submenu">
        <li><a href="/contactus">联系方式</a></li>
        <li class="leftact"><a href="/contactus/leavemessage">客户留言</a></li>
    </ul>
    @Html.Partial("_ShareLeftBar")
</div>
<div class="subright">
    <div class="pagepath"><a href="/"><img src="/Images/homeicon.jpg" alt="首页" /></a> &gt; <a href="/contactus">联系我们</a> &gt; <a href="/contactus/leavemessage">客户留言</a></div>
    <div class="midcontent">
        <input type="hidden" id="cstatus" value="@ViewBag.Msg" />
        <div class="pagehead1">
            <img src="/Images/news01.jpg" alt="" /><span class="pheadtxt1">请写下您的建议，让我们做得更好</span>
            <div class="cls"></div>
        </div>
        <ul class="lmsgform">
            @using (Html.BeginForm())
            {
                <li>您的名称(<font color="red">*</font>)：<input type="text" class="lmsg_input" name="username" id="username" /></li>
                <li>电子邮箱：<input type="text" class="lmsg_input" name="email" style="margin-left:16px" /></li>
                <li>联系电话：<input type="text" class="lmsg_input" name="mobile" style="margin-left:16px" /></li>
                <li>建议留言(<font color="red">*</font>)：<textarea class="lmsg_input" style="width: 430px; height: 100px; vertical-align:top" name="msg" id="msg"></textarea></li>
                <li class="lline"></li>
                <li class="lmsg_btn">
                    <span class="cbtn2" id="btn_post">提交</span>
                    <span class="cbtn2" onclick="javascript:document.forms[0].reset();">重填</span>
                </li>
            }
        </ul>
    </div>
</div>
<div class="cls"></div>

@section scripts
{
    <script type="text/javascript">
        $(function () {
            var cstatus = $("#cstatus").val();
            if (cstatus != "") {
                if (cstatus == "created") {
                    alert("留言信息已经发送给网站管理员，感谢您的支持。");
                    window.location.href = "/contactus/leavemessage";
                }
                else {
                    alert(cstatus);
                }
            }

            $("#btn_post").click(function () {
                var username = $("#username").val();
                var msg = $("#msg").val();
                if ($.trim(username) == "") {
                    alert("请填写您的名称");
                }
                else if (msg.length < 8) {
                    alert("请不要吝言，以帮助我们提高服务质量，谢谢。");
                }
                else {
                    document.forms[0].submit();
                }
            });
        });
    </script>
}
